import { Injectable } from '@nestjs/common';
import { Client, fetchExchange } from '@urql/core';

@Injectable()
export class HasuraService extends Client {
  constructor() {
    super({
      url: 'http://localhost:8080/v1/graphql',
      exchanges: [fetchExchange],
      fetchOptions: (): RequestInit => ({
        headers: {
          'X-Hasura-Admin-Secret': '',
        },
      }),
    });
  }

}
